package com.cqhfan.contentservice.controller;

import com.cqhfan.contentservice.service.CommentService;
import com.cqhfan.core.domain.dto.PageDTO;
import com.cqhfan.pojo.content.dto.AddCommentDTO;
import com.cqhfan.pojo.content.query.CommentQuery;
import com.cqhfan.pojo.content.vo.CommentVO;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author 眭传洪
 * @create 2025-08-13 23:48
 */
@RestController
@RequestMapping("/comment")
@RequiredArgsConstructor
public class CommentController {

    private final CommentService commentService;

    @PostMapping("/addComment")
    public void addComment(@RequestBody AddCommentDTO body) {
        commentService.addComment(body);
    }

    @GetMapping("/pageComment")
    public PageDTO<CommentVO> pageComment(CommentQuery query) {
        return commentService.pageComment(query);
    }

}
